import time

from selenium.webdriver.common.by import By
from yuekao.UI.po.cconfig.Base import Base

class Page(Base):
    dy1=(By.XPATH,'/html/body/div[1]/div/div[3]/div[2]/form/div[4]/div/div[1]/a[1]')
    def dy1_loc(self):
       return self.text(self.dy1)
    ss=(By.XPATH,'/html/body/div[1]/div/div[3]/div[2]/form/div[1]/input')
    def ss_loc(self):
        self.send_keys(self.ss,'软件测试自动化')
    ssan=(By.XPATH,'/html/body/div[1]/div/div[3]/div[2]/form/label')
    def ssan_loc(self):
        self.click(self.ssan)
    dy3=(By.XPATH,'/html/body')
    def dy3_loc(self):
        return self.text(self.dy3)
    # 点击下一页
    xyy=(By.XPATH,'/html/body/div[3]/main/div[2]/ol[2]/li[14]/nav/ul/li[6]/a')
    def xyy_loc(self):
        self.click(self.xyy)
    dy4=(By.XPATH,'/html/body')
    def dy4_loc(self):
        return self.text(self.dy4)
    def test_Bing_ss(self):
        self.open('https://cn.bing.com/')
        time.sleep(2)
        assert '必应上的热点' == self.dy1_loc()
        print(self.dy1_loc())
        time.sleep(2)
        self.ss_loc()
        time.sleep(2)
        self.ssan_loc()
        time.sleep(2)
        assert '软件测试' in self.dy3_loc()
        print(self.dy3_loc())
        time.sleep(2)
        # self.xyy_loc()
        # self.ys()
        # assert '软件测试' in self.dy4_loc()
        # print(self.dy4_loc())
        # time.sleep(2)

